package com.hongdong.flowable.controller;

import com.hongdong.flowable.common.RequestResult;

import java.util.Date;

public class WebBaseController {

    public <T> RequestResult<T> success(T data){
        RequestResult<T> result = new RequestResult<>();
        result.setData(data);
        result.setStatus(0);
        result.setMsg("success");
        result.setRequestTime(new Date());
        return result;
    }

    public <Void> RequestResult<Void> fail(String msg){
        RequestResult<Void> result = new RequestResult<>();
        result.setStatus(1);
        result.setMsg(msg);
        result.setRequestTime(new Date());
        return result;
    }

}
